package com.ssy.jt808.gateway.sdk.terminal.converter.location.addition;

import com.ssy.jt808.gateway.sdk.terminal.pojo.info.IoStateInfo;
import com.ssy.jt808.gateway.sdk.terminal.utils.BitUtil;

/**
 * @author wangzezhou
 */
public class IoStateInfoConverter{

  /** 近光灯 */
  public static int DEEP_SLEEP = 0x01;
  /** 远光灯 */
  public static int SLEEP = 0x01<<1;


  public static IoStateInfo convertIoStatusInfo( int ioState ){

    IoStateInfo info = new IoStateInfo();

    info.setDeepSleep(BitUtil.existFlag(ioState, DEEP_SLEEP));
    info.setSleep(BitUtil.existFlag(ioState, SLEEP));

    return info;
  }
}
